//
//  RootTabBarViewController.m
//  Mall
//
//  Created by 孙飞燕 on 16/9/28.
//  Copyright © 2016年 孙飞燕. All rights reserved.
//

#import "RootTabBarViewController.h"
#import "HomePageViewController.h"
#import "CategoryViewController.h"
#import "ShoppingViewController.h"
#import "PersonalCenterViewController.h"
@interface RootTabBarViewController ()

@end

@implementation RootTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    HomePageViewController *homePageVC = [[HomePageViewController alloc]init];
    UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:homePageVC];
    
    CategoryViewController *categoryVC = [[CategoryViewController alloc]init];
    UINavigationController *navi1 = [[UINavigationController alloc]initWithRootViewController:categoryVC];
    
    ShoppingViewController *shoppingVC = [[ShoppingViewController alloc]init];
    UINavigationController *navi2 = [[UINavigationController alloc]initWithRootViewController:shoppingVC];
    
    PersonalCenterViewController *personalCenterVC = [[PersonalCenterViewController alloc]init];
    UINavigationController *navi3 = [[UINavigationController alloc]initWithRootViewController:personalCenterVC];
    
    self.viewControllers = @[navi,navi1,navi2,navi3];
    navi.tabBarItem.title = @"首页";
    navi.tabBarItem.image = [UIImage imageNamed:@"house"];
    
    navi1.tabBarItem.title = @"产品";
    navi1.tabBarItem.image = [UIImage imageNamed:@"categorize"];
    
    navi2.tabBarItem.title = @"购物车";
    navi2.tabBarItem.image = [UIImage imageNamed:@"shopCar"];
    
    navi3.tabBarItem.title = @"个人中心";
    navi3.tabBarItem.image = [UIImage imageNamed:@"PersonalCenter"];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
